<template>
  <div id="app">
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";
import "@/utils/cssutils/style_scss.scss";
import { getInfo } from '@/api/login'

export default {
  name: "App",
  components: { ThemePicker },
    metaInfo() {
        return {
            title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
            titleTemplate: title => {
                return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
            }
        }
    },
    data() {
      return {
        timer: null
      }
    },
    created() {
      this.timer = setInterval(() => {
        getInfo().then(response => {}).catch(error => {})
      }, 1000*60*10);
    },
    beforeDestroy() {
      if (this.timer) {
        clearInterval(this.timer);
      }
    }
};
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
</style>
